package com.starlink.model.util;

import com.starlink.model.dtomapper.MallBooksCategoryDtoMapper;
import com.starlink.model.domain.MallBooksCategoryDO;
import com.starlink.model.vo.MallBooksCategoryVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallBooksCategoryConvert {

    public static List<MallBooksCategoryVO> buildMallBooksCategoryVoList(List<MallBooksCategoryDO> mallBooksCategoryDOList) {
        if (CollectionUtils.isEmpty(mallBooksCategoryDOList)) {
            return Lists.newArrayList();
        }
        List<MallBooksCategoryVO> mallBooksCategoryVOList = new ArrayList<>();
        for (MallBooksCategoryDO mallBooksCategoryDO : mallBooksCategoryDOList) {
            mallBooksCategoryVOList.add(MallBooksCategoryDtoMapper.INSTANCE.do2VO(mallBooksCategoryDO));
        }

        return mallBooksCategoryVOList;
    }
}
